__author__ = 'ezhenyz'


from django import forms
from CARTOON.models import VFormat

class AddCartoonForm(forms.Form):
    oformats = VFormat.objects.all()
    #formats = [('avi','avi'), ('mkv', 'mkv'), ('mp4', 'mp4'), ('rmvb', 'rmvb'), ('mpg', 'mpg')];
    formats = []
    for oformat in oformats:
        formats.append((oformat.vFormat, oformat.vFormat))

    name = forms.CharField(widget=forms.TextInput(attrs={'size':51,}))
    path = forms.CharField(widget=forms.TextInput(attrs={'size':51,}))
    episodeNum = forms.CharField(required=False)
    company = forms.CharField(required=False)
    date = forms.DateField()
    vFormats = forms.MultipleChoiceField(choices=formats, initial=["rmvb"])

class SearchCartoonForm(forms.Form):
    """

    """
    name = forms.CharField(required=False)
    company = forms.CharField(required=False)
    date = forms.DateField(required=False)

class EditCartoonForm(AddCartoonForm):
    #cid = forms.HiddenInput()
    pass

class DeleteCartoonForm(AddCartoonForm):
    pass